

#include "DataSourceSub.h"
#include <string>

DataSourceSub::DataSourceSub(void)
{
}

DataSourceSub::~DataSourceSub(void)
{
}

int DataSourceSub::GetStatusJson(char byteBuffe[],int& bufferSize)
{
	memset(byteBuffe,0,bufferSize);
	std::string str="{\"status\":\"1\",\"cacheTimeStamp\":\"1326351373900\"}";
	memcpy(byteBuffe,str.c_str(),str.size());
	bufferSize=str.size();
	return 0;
}
int DataSourceSub::GetSlotsJson(char byteBuffer[],int& bufferSize) 
{
	memset(byteBuffer,0,bufferSize);
	std::string str="																										\
								{																							\
								\"Slot\":[																					\
								{\"id\":\"1\",\"width\":\"180\",\"height\":\"109\",\"xPos\":\"451\", \"yPos\":\"300\"},		\
								{\"id\":\"3\",\"width\":\"180\",\"height\":\"109\",\"xPos\":\"451\", \"yPos\":\"300\"},		\
								{\"id\":\"9\",\"width\":\"180\",\"height\":\"109\",\"xPos\":\"451\", \"yPos\":\"300\"}		\
								],																							\
								\"retcode\":\"0\"																			\
								}";
	memcpy(byteBuffer,str.c_str(),str.size());
	bufferSize=str.size();
	return 0;
}
int DataSourceSub::GetAdListJson(int soltId,int maxResultCount,char byteBuffer[],int& bufferSize) 
{
	memset(byteBuffer,0,bufferSize);
	std::string str="{\"return_code\":\"0\"}";

	memcpy(byteBuffer,str.c_str(),str.size());
	bufferSize=str.size();
	return 0;
}
